package com.jishuo.nontax.web.bill;

import com.jishuo.base.annotation.UserAuthority;
import com.jishuo.base.bean.BaseResult;
import com.jishuo.base.bean.GridResult;
import com.jishuo.base.bean.Pagination;
import com.jishuo.nontax.bean.vo.ChargeBillDetailVO;
import com.jishuo.nontax.bean.vo.ChargeBillVO;
import com.jishuo.nontax.bean.vo.SumPosVO;
import com.jishuo.nontax.bfc.service.BankposService;
import com.jishuo.nontax.bfc.service.ChargeBillService;
import com.jishuo.nontax.bfc.service.SumposService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * pos
 */
@Slf4j
@Controller
@RequestMapping(value = "/bill/bankpos", name = "缴款书")
public class BankPosController {
    @Resource
    private SumposService sumposService;
    @Resource
    private BankposService bankposService;

    // 页面文件位置
    private String prefix = "bill/";

    @RequestMapping(value = {"bankpos", "bankpos/{page}"}, name = "缴款书首页")
    public String index(@PathVariable(required = false) String page) {
        return prefix + ((page == null) ? "bankpos" : page);
    }

    /**
     * @author hlp
     * @date 2023/3/2 14:22
     * @Description:  pos信息列表分页
     */
    @ResponseBody
    @RequestMapping(value = "findBankPosPage", name = "pos信息列表分页")
    public GridResult<SumPosVO> findBankPosPage(SumPosVO sumPosVO, Pagination pagination) {
        return new GridResult<>(sumposService.findBankPosPage(sumPosVO,pagination));
    }

    @ResponseBody
    @RequestMapping(value = "/sendDeleteBankPos",name = "删除pos信息")
    public BaseResult sendDeleteBankPos(String accountnum,String accountdate,String types,String usercode,String userpwd){
         return bankposService.sendDeleteBankPos(accountnum, accountdate, types, usercode, userpwd);
    }

}
